package com.allenkerr.job;

import com.allenkerr.dao.GirlRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * Created by 小柯 on 17/7/13.
 */
@Component
public class TaskLauncher {

    @Autowired
    private GirlRepository girlRepository;

    /**
     * 启动后执行
     */
    @PostConstruct
    public void doAfterSystemStartup() {
        System.out.println("TaskLauncher.doAfterSystemStartup");
        System.out.println("girlRepository = " + girlRepository);
    }

    /**
     * 关闭前执行
     */
    @PreDestroy
    public void doBeforeSystemShutdown() {
        System.out.println("TaskLauncher.doBeforeSystemShutdown");
        System.out.println("girlRepository = " + girlRepository);
    }

}